﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AMAP.Areas.Admin.Models.Home;
using AMAP.ServiceInterfaces;

namespace AMAP.Areas.Admin.Controllers
{
    public class HomeController : Controller
    {
        private IVolunteerService VolonteerService;
        //
        // GET: /Admin/Home/

        public HomeController(IVolunteerService VolonteerService)
        {
            this.VolonteerService = VolonteerService;
        }

        [Authorize(Roles = "President")]
        public ActionResult Index()
        {
            AdminHomeIndexViewModel Model = new AdminHomeIndexViewModel();
            Model.Volunteer = this.VolonteerService.GetByEmail(User.Identity.Name);
            return View(Model);
        }

    }
}
